





<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>tvm.ir &mdash; tvm 0.8.dev1982 文档</title>
  

  
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
  <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/gallery.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/tlcpack_theme.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/tvm-logo-square.png"/>
  

  
  
  
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/translations.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <script type="text/javascript" src="../../../_static/js/tlcpack_theme.js"></script>
    <link rel="index" title="索引" href="../../../genindex.html" />
    <link rel="search" title="搜索" href="../../../search.html" />
    <link rel="next" title="tvm.target" href="target.html" />
    <link rel="prev" title="tvm.error" href="error.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    
<header class="header">
    <div class="innercontainer">
      <div class="headerInner d-flex justify-content-between align-items-center">
          <div class="headerLogo">
               <a href="https://tvm.apache.org/"><img src=https://tvm.apache.org/assets/images/logo.svg alt="logo"></a>
          </div>

          <div id="headMenu" class="headerNav">
            <button type="button" id="closeHeadMenu" class="navCloseBtn"><img src="../../../_static/img/close-icon.svg" alt="Close"></button>
             <ul class="nav">
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/community>Community</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/download>Download</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/vta>VTA</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/blog>Blog</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvm.apache.org/docs>Docs</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmconf.org>Conference</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://github.com/apache/tvm/>Github</a>
                </li>
                <li class="nav-item">
                   <a class="nav-link" href=https://tvmchinese.github.io/declaration_zh_CN.html>About-Translators</a>
                </li>
             </ul>
               <div class="responsivetlcdropdown">
                 <button type="button" class="btn-link">
                   ASF
                 </button>
                 <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                 </ul>
               </div>
          </div>
            <div class="responsiveMenuIcon">
              <button type="button" id="menuBtn" class="btn-menu"><img src="../../../_static/img/menu-icon.svg" alt="Menu Icon"></button>
            </div>

            <div class="tlcDropdown">
              <div class="dropdown">
                <button type="button" class="btn-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                  ASF
                </button>
                <div class="dropdown-menu dropdown-menu-right">
                  <ul>
                     <li>
                       <a href=https://apache.org/>Apache Homepage</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/licenses/>License</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/security/>Security</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/foundation/thanks.html>Thanks</a>
                     </li>
                     <li>
                       <a href=https://www.apache.org/events/current-event>Events</a>
                     </li>
                     <li>
                       <a href=https://www.zhihu.com/column/c_1429578595417563136>Zhihu</a>
                     </li>
                  </ul>
                </div>
              </div>
          </div>
       </div>
    </div>
 </header>
 
    <nav data-toggle="wy-nav-shift" class="wy-nav-side fixed">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../../index.html">
          

          
            
            <img src="../../../_static/tvm-logo-small.png" class="logo" alt="Logo"/>
          
          </a>

          
            
            
                <div class="version">
                  0.8.dev1982
                </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption" role="heading"><span class="caption-text">如何开始</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../install/index.html">安装 TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../contribute/index.html">贡献者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">用户引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../tutorial/index.html">User Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../how_to/index.html">How To Guides</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">开发者引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/tutorial/index.html">Developer Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/how_to/how_to.html">开发者指南</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">架构指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../arch/index.html">Design and Architecture</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">主题引导</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../topic/microtvm/index.html">microTVM：裸机使用TVM</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../topic/vta/index.html">VTA: Versatile Tensor Accelerator</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">参考指南</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../langref/index.html">语言参考</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Python API</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="runtime.html">tvm.runtime</a></li>
<li class="toctree-l2"><a class="reference internal" href="ndarray.html">tvm.runtime.ndarray</a></li>
<li class="toctree-l2"><a class="reference internal" href="error.html">tvm.error</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">tvm.ir</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-tvm.instrument">tvm.instrument</a></li>
<li class="toctree-l2"><a class="reference internal" href="#module-tvm.transform">tvm.transform</a></li>
<li class="toctree-l2"><a class="reference internal" href="target.html">tvm.target</a></li>
<li class="toctree-l2"><a class="reference internal" href="tir.html">tvm.tir</a></li>
<li class="toctree-l2"><a class="reference internal" href="tir.html#module-tvm.tir.transform">tvm.tir.transform</a></li>
<li class="toctree-l2"><a class="reference internal" href="tir.html#tvm-tir-analysis">tvm.tir.analysis</a></li>
<li class="toctree-l2"><a class="reference internal" href="tir.html#module-tvm.tir.stmt_functor">tvm.tir.stmt_functor</a></li>
<li class="toctree-l2"><a class="reference internal" href="te.html">tvm.te</a></li>
<li class="toctree-l2"><a class="reference internal" href="te.html#module-tvm.te.hybrid">tvm.te.hybrid</a></li>
<li class="toctree-l2"><a class="reference internal" href="driver.html">tvm.driver</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/index.html">tvm.relay</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/frontend.html">tvm.relay.frontend</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/nn.html">tvm.relay.nn</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/vision.html">tvm.relay.vision</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/image.html">tvm.relay.image</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/transform.html">tvm.relay.transform</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/analysis.html">tvm.relay.analysis</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/backend.html">tvm.relay.backend</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/dataflow_pattern.html">tvm.relay.dataflow_pattern</a></li>
<li class="toctree-l2"><a class="reference internal" href="relay/testing.html">tvm.relay.testing</a></li>
<li class="toctree-l2"><a class="reference internal" href="autotvm.html">tvm.autotvm</a></li>
<li class="toctree-l2"><a class="reference internal" href="auto_scheduler.html">tvm.auto_scheduler</a></li>
<li class="toctree-l2"><a class="reference internal" href="rpc.html">tvm.rpc</a></li>
<li class="toctree-l2"><a class="reference internal" href="micro.html">tvm.micro</a></li>
<li class="toctree-l2"><a class="reference internal" href="contrib.html">tvm.contrib</a></li>
<li class="toctree-l2"><a class="reference internal" href="graph_executor.html">tvm.contrib.graph_executor</a></li>
<li class="toctree-l2"><a class="reference internal" href="topi.html">tvm.topi</a></li>
<li class="toctree-l2"><a class="reference internal" href="vta/index.html">vta</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../links.html">Other APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../publications.html">Publications</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../genindex.html">索引</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
      
      <nav class="wy-nav-top" aria-label="top navigation" data-toggle="wy-nav-top">
        
            <div class="togglemenu">

            </div>
            <div class="nav-content">
              <!-- tvm -->
              Table of content
            </div>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        

          




















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../index.html">Docs</a> <span class="br-arrow">></span></li>
        
          <li><a href="index.html">Python API</a> <span class="br-arrow">></span></li>
        
      <li>tvm.ir</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../../../_sources/reference/api/python/ir.rst.txt" rel="nofollow"> <img src="../../../_static//img/source.svg" alt="viewsource"/></a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="module-tvm.ir">
<span id="tvm-ir"></span><h1>tvm.ir<a class="headerlink" href="#module-tvm.ir" title="永久链接至标题">¶</a></h1>
<p>IR相关的常见数据结构</p>
<p><strong>类：</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.SourceName" title="tvm.ir.SourceName"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SourceName</span></code></a>(name)</p></td>
<td><p>A identifier for a source location.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Span" title="tvm.ir.Span"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Span</span></code></a>(source_name, line, end_line, column, …)</p></td>
<td><p>Specifies a location in a source program.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Node" title="tvm.ir.Node"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Node</span></code></a>()</p></td>
<td><p>Base class of all IR Nodes, implements astext function.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.EnvFunc" title="tvm.ir.EnvFunc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">EnvFunc</span></code></a>()</p></td>
<td><p>Environment function.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Type</span></code></a>()</p></td>
<td><p>The base class of all types.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.TypeKind" title="tvm.ir.TypeKind"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TypeKind</span></code></a>(value)</p></td>
<td><p>Possible kinds of TypeVars.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.PrimType" title="tvm.ir.PrimType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PrimType</span></code></a>(dtype)</p></td>
<td><p>Primitive data type in the low level IR</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.PointerType" title="tvm.ir.PointerType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PointerType</span></code></a>(element_type[, storage_scope])</p></td>
<td><p>PointerType used in the low-level TIR.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.TypeVar" title="tvm.ir.TypeVar"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TypeVar</span></code></a>(name_hint[, kind])</p></td>
<td><p>Type parameter in functions.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.GlobalTypeVar" title="tvm.ir.GlobalTypeVar"><code class="xref py py-obj docutils literal notranslate"><span class="pre">GlobalTypeVar</span></code></a>(name_hint[, kind])</p></td>
<td><p>A global type variable that is used for defining new types or type aliases.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.TupleType" title="tvm.ir.TupleType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TupleType</span></code></a>(fields)</p></td>
<td><p>The type of tuple values.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.TypeConstraint" title="tvm.ir.TypeConstraint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TypeConstraint</span></code></a>()</p></td>
<td><p>Abstract class representing a type constraint.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.FuncType" title="tvm.ir.FuncType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">FuncType</span></code></a>(arg_types, ret_type[, type_params, …])</p></td>
<td><p>Function type.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.IncompleteType" title="tvm.ir.IncompleteType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">IncompleteType</span></code></a>([kind])</p></td>
<td><p>Incomplete type during type inference.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.RelayRefType" title="tvm.ir.RelayRefType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RelayRefType</span></code></a>(value)</p></td>
<td><p>Reference Type in relay.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.TensorType" title="tvm.ir.TensorType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TensorType</span></code></a>(shape[, dtype])</p></td>
<td><p>A concrete TensorType in Relay.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.TensorAffineType" title="tvm.ir.TensorAffineType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TensorAffineType</span></code></a>(scale, zero_point, dtype[, …])</p></td>
<td><p>The quantized type of a tensor, with scale, zero point, and datatype</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.TupleAffineType" title="tvm.ir.TupleAffineType"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TupleAffineType</span></code></a>(types)</p></td>
<td><p>Affine types of a node with multiple outputs</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.TypeCall" title="tvm.ir.TypeCall"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TypeCall</span></code></a>(func, args)</p></td>
<td><p>Type function application.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.TypeRelation" title="tvm.ir.TypeRelation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TypeRelation</span></code></a>(func, args, num_inputs, attrs)</p></td>
<td><p>User defined type relation, it is an input-output relation on types.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.BaseExpr" title="tvm.ir.BaseExpr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">BaseExpr</span></code></a>()</p></td>
<td><p>Base class of all the expressions.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.PrimExpr" title="tvm.ir.PrimExpr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">PrimExpr</span></code></a>()</p></td>
<td><p>Base class of all primitive expressions.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.RelayExpr" title="tvm.ir.RelayExpr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RelayExpr</span></code></a>()</p></td>
<td><p>Base class of all non-primitive expressions.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.GlobalVar" title="tvm.ir.GlobalVar"><code class="xref py py-obj docutils literal notranslate"><span class="pre">GlobalVar</span></code></a>(name_hint)</p></td>
<td><p>A global variable in the IR.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Range" title="tvm.ir.Range"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Range</span></code></a>(begin[, end, span])</p></td>
<td><p>Represent a range in TVM.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Op" title="tvm.ir.Op"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Op</span></code></a>()</p></td>
<td><p>Primitive operator in the IR.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.CallingConv" title="tvm.ir.CallingConv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">CallingConv</span></code></a>(value)</p></td>
<td><p>Possible kinds of calling conventions.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.BaseFunc" title="tvm.ir.BaseFunc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">BaseFunc</span></code></a>()</p></td>
<td><p>Base class of all functions.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Constructor" title="tvm.ir.Constructor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Constructor</span></code></a>(name_hint, inputs, belong_to)</p></td>
<td><p>Relay ADT constructor.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.TypeData" title="tvm.ir.TypeData"><code class="xref py py-obj docutils literal notranslate"><span class="pre">TypeData</span></code></a>(header, type_vars, constructors)</p></td>
<td><p>Stores the definition for an Algebraic Data Type (ADT) in Relay.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.IRModule" title="tvm.ir.IRModule"><code class="xref py py-obj docutils literal notranslate"><span class="pre">IRModule</span></code></a>([functions, type_definitions])</p></td>
<td><p>IRModule that holds functions and type definitions.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Attrs" title="tvm.ir.Attrs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Attrs</span></code></a>()</p></td>
<td><p>Attribute node, which is mainly use for defining attributes of relay operators.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.DictAttrs" title="tvm.ir.DictAttrs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DictAttrs</span></code></a>()</p></td>
<td><p>Dictionary attributes.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Array" title="tvm.ir.Array"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Array</span></code></a>()</p></td>
<td><p>Array container of TVM.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Map" title="tvm.ir.Map"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Map</span></code></a>()</p></td>
<td><p>Map container of TVM.</p></td>
</tr>
</tbody>
</table>
<p><strong>函数：</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.load_json" title="tvm.ir.load_json"><code class="xref py py-obj docutils literal notranslate"><span class="pre">load_json</span></code></a>(json_str)</p></td>
<td><p>Load tvm object from json_str.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.save_json" title="tvm.ir.save_json"><code class="xref py py-obj docutils literal notranslate"><span class="pre">save_json</span></code></a>(node)</p></td>
<td><p>Save tvm object as json string.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.structural_equal" title="tvm.ir.structural_equal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">structural_equal</span></code></a>(lhs, rhs[, map_free_vars])</p></td>
<td><p>Check structural equality of lhs and rhs.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.assert_structural_equal" title="tvm.ir.assert_structural_equal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assert_structural_equal</span></code></a>(lhs, rhs[, …])</p></td>
<td><p>Assert lhs and rhs are structurally equal to each other.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.structural_hash" title="tvm.ir.structural_hash"><code class="xref py py-obj docutils literal notranslate"><span class="pre">structural_hash</span></code></a>(node[, map_free_vars])</p></td>
<td><p>Compute structural hash of node</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.register_op_attr" title="tvm.ir.register_op_attr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">register_op_attr</span></code></a>(op_name, attr_key[, value, …])</p></td>
<td><p>Register an operator property of an operator by name.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.register_intrin_lowering" title="tvm.ir.register_intrin_lowering"><code class="xref py py-obj docutils literal notranslate"><span class="pre">register_intrin_lowering</span></code></a>(op_name, target, *)</p></td>
<td><p>Register Op lowering function</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.make_node" title="tvm.ir.make_node"><code class="xref py py-obj docutils literal notranslate"><span class="pre">make_node</span></code></a>(type_key, **kwargs)</p></td>
<td><p>Make a new IR node by its type key and fields</p></td>
</tr>
</tbody>
</table>
<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.SourceName">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">SourceName</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.SourceName" title="永久链接至目标">¶</a></dt>
<dd><p>A identifier for a source location.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of the source.</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Span">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Span</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">source_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">line</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end_line</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">column</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end_column</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Span" title="永久链接至目标">¶</a></dt>
<dd><p>Specifies a location in a source program.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>source</strong> (<a class="reference internal" href="#tvm.ir.SourceName" title="tvm.ir.SourceName"><em>SourceName</em></a>) – The source name.</p></li>
<li><p><strong>lineno</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The line number.</p></li>
<li><p><strong>col_offset</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The column offset of the location.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Node">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Node</span></span><a class="headerlink" href="#tvm.ir.Node" title="永久链接至目标">¶</a></dt>
<dd><p>Base class of all IR Nodes, implements astext function.</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Node.astext" title="tvm.ir.Node.astext"><code class="xref py py-obj docutils literal notranslate"><span class="pre">astext</span></code></a>([show_meta_data, annotate])</p></td>
<td><p>Get the text format of the expression.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Node.astext">
<span class="sig-name descname"><span class="pre">astext</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">show_meta_data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">annotate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Node.astext" title="永久链接至目标">¶</a></dt>
<dd><p>Get the text format of the expression.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>show_meta_data</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)"><em>bool</em></a>) – Whether to include meta data section in the text
if there is meta data.</p></li>
<li><p><strong>annotate</strong> (<em>Optional</em><em>[</em><em>Object-&gt;str</em><em>]</em>) – Optionally annotate function to provide additional
information in the comment block.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>text</strong> – The text format of the expression.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)">str</a></p>
</dd>
</dl>
<p class="rubric">提示</p>
<p>The meta data section is necessary to fully parse the text format.
However, it can contain dumps that are big (e.g constant weights),
so it can be helpful to skip printing the meta data section.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.EnvFunc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">EnvFunc</span></span><a class="headerlink" href="#tvm.ir.EnvFunc" title="永久链接至目标">¶</a></dt>
<dd><p>Environment function.</p>
<p>This is a global function object that can be serialized by its name.</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.EnvFunc.get" title="tvm.ir.EnvFunc.get"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get</span></code></a>(name)</p></td>
<td><p>Get a static env function</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.EnvFunc.get">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.EnvFunc.get" title="永久链接至目标">¶</a></dt>
<dd><p>Get a static env function</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of the function.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.load_json">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">load_json</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">json_str</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.load_json" title="永久链接至目标">¶</a></dt>
<dd><p>Load tvm object from json_str.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>json_str</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The json string</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>node</strong> – The loaded tvm node.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object">Object</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.save_json">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">save_json</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.save_json" title="永久链接至目标">¶</a></dt>
<dd><p>Save tvm object as json string.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>node</strong> (<a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object"><em>Object</em></a>) – A TVM object to be saved.</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>json_str</strong> – Saved json string.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)">str</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.structural_equal">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">structural_equal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lhs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rhs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">map_free_vars</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.structural_equal" title="永久链接至目标">¶</a></dt>
<dd><p>Check structural equality of lhs and rhs.</p>
<p>The structural equality is recursively defined in the DAG of IRNodes.
There are two kinds of nodes:</p>
<ul class="simple">
<li><p>Graph node: a graph node in lhs can only be mapped as equal to
one and only one graph node in rhs.</p></li>
<li><p>Normal node: equality is recursively defined without the restriction
of graph nodes.</p></li>
</ul>
<p>Vars(tir::Var, TypeVar) and non-constant relay expression nodes are graph nodes.
For example, it means that <cite>%1 = %x + %y; %1 + %1</cite> is not structurally equal
to <cite>%1 = %x + %y; %2 = %x + %y; %1 + %2</cite> in relay.</p>
<p>A var-type node(e.g. tir::Var, TypeVar) can be mapped as equal to another var
with the same type if one of the following condition holds:</p>
<ul class="simple">
<li><p>They appear in a same definition point(e.g. function argument).</p></li>
<li><p>They points to the same VarNode via the same_as relation.</p></li>
<li><p>They appear in a same usage point, and map_free_vars is set to be True.</p></li>
</ul>
<p>The rules for var are used to remap variables occurs in function
arguments and let-bindings.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lhs</strong> (<a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object"><em>Object</em></a>) – The left operand.</p></li>
<li><p><strong>rhs</strong> (<a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object"><em>Object</em></a>) – The left operand.</p></li>
<li><p><strong>map_free_vars</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)"><em>bool</em></a>) – Whether or not shall we map free vars that does
not bound to any definitions as equal to each other.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>result</strong> – The comparison result.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)">bool</a></p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference internal" href="#tvm.ir.structural_hash" title="tvm.ir.structural_hash"><code class="xref py py-obj docutils literal notranslate"><span class="pre">structural_hash</span></code></a>, <code class="xref py py-obj docutils literal notranslate"><span class="pre">assert_strucural_equal</span></code></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.assert_structural_equal">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">assert_structural_equal</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">lhs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rhs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">map_free_vars</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.assert_structural_equal" title="永久链接至目标">¶</a></dt>
<dd><p>Assert lhs and rhs are structurally equal to each other.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lhs</strong> (<a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object"><em>Object</em></a>) – The left operand.</p></li>
<li><p><strong>rhs</strong> (<a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object"><em>Object</em></a>) – The left operand.</p></li>
<li><p><strong>map_free_vars</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)"><em>bool</em></a>) – Whether or not shall we map free vars that does
not bound to any definitions as equal to each other.</p></li>
</ul>
</dd>
</dl>
<p>:raises ValueError : if assertion does not hold.:</p>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><a class="reference internal" href="#tvm.ir.structural_equal" title="tvm.ir.structural_equal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">structural_equal</span></code></a></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.structural_hash">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">structural_hash</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">map_free_vars</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.structural_hash" title="永久链接至目标">¶</a></dt>
<dd><p>Compute structural hash of node</p>
<p>The structural hash value is recursively defined in the DAG of IRNodes.
There are two kinds of nodes:</p>
<ul class="simple">
<li><p>Normal node: the hash value is defined by its content and type only.</p></li>
<li><p>Graph node: each graph node will be assigned a unique index ordered by the
first occurence during the visit. The hash value of a graph node is
combined from the hash values of its contents and the index.</p></li>
</ul>
<p>structural_hash is made to be concistent with structural_equal.
If two nodes are structurally equal to each other,
then their structural hash (with the same map_free_vars option)
should be equal to each other as well.</p>
<p>If the structural hash of two nodes equals to each other,
then it is highly likely(except for rare hash value collison cases)
that the two nodes are structurally equal to each other.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>node</strong> (<a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object"><em>Object</em></a>) – The input to be hashed.</p></li>
<li><p><strong>map_free_vars</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)"><em>bool</em></a>) – If map_free_vars is set to true, we will hash free variables
by the order of their occurences. Otherwise, we will hash by
their in-memory pointer address.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>result</strong> – The hash result</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)">int</a></p>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">参见</p>
<p><code class="xref py py-obj docutils literal notranslate"><span class="pre">structrual_equal</span></code></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Type">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Type</span></span><a class="headerlink" href="#tvm.ir.Type" title="永久链接至目标">¶</a></dt>
<dd><p>The base class of all types.</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Type.same_as" title="tvm.ir.Type.same_as"><code class="xref py py-obj docutils literal notranslate"><span class="pre">same_as</span></code></a>(other)</p></td>
<td><p>Compares two Relay types by referential equality.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Type.same_as">
<span class="sig-name descname"><span class="pre">same_as</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Type.same_as" title="永久链接至目标">¶</a></dt>
<dd><p>Compares two Relay types by referential equality.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TypeKind">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TypeKind</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TypeKind" title="永久链接至目标">¶</a></dt>
<dd><p>Possible kinds of TypeVars.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.PrimType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">PrimType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dtype</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.PrimType" title="永久链接至目标">¶</a></dt>
<dd><p>Primitive data type in the low level IR</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>dtype</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The runtime data type relates to the primtype.</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.PointerType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">PointerType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">element_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">storage_scope</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.PointerType" title="永久链接至目标">¶</a></dt>
<dd><p>PointerType used in the low-level TIR.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>element_type</strong> (<a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>tvm.ir.Type</em></a>) – The type of pointer’s element.</p></li>
<li><p><strong>storage_scope</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The storage scope into which the pointer addresses.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TypeVar">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TypeVar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name_hint</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kind</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">TypeKind.Type</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TypeVar" title="永久链接至目标">¶</a></dt>
<dd><p>Type parameter in functions.</p>
<p>A type variable represents a type placeholder which will
be filled in later on. This allows the user to write
functions which are generic over types.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name_hint</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of the type variable. This name only acts as a hint, and
is not used for equality.</p></li>
<li><p><strong>kind</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="#tvm.ir.TypeKind" title="tvm.ir.TypeKind"><em>TypeKind</em></a><em>]</em>) – The kind of the type parameter.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.GlobalTypeVar">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">GlobalTypeVar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name_hint</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">kind</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">TypeKind.AdtHandle</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.GlobalTypeVar" title="永久链接至目标">¶</a></dt>
<dd><p>A global type variable that is used for defining new types or type aliases.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name_hint</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of the type variable. This name only acts as a hint, and
is not used for equality.</p></li>
<li><p><strong>kind</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="#tvm.ir.TypeKind" title="tvm.ir.TypeKind"><em>TypeKind</em></a><em>]</em>) – The kind of the type parameter.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TupleType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TupleType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">fields</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TupleType" title="永久链接至目标">¶</a></dt>
<dd><p>The type of tuple values.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>fields</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>Type</em></a><em>]</em>) – The fields in the tuple</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TypeConstraint">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TypeConstraint</span></span><a class="headerlink" href="#tvm.ir.TypeConstraint" title="永久链接至目标">¶</a></dt>
<dd><p>Abstract class representing a type constraint.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.FuncType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">FuncType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg_types</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ret_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type_params</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type_constraints</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.FuncType" title="永久链接至目标">¶</a></dt>
<dd><p>Function type.</p>
<p>A function type consists of a list of type parameters to enable
the definition of generic functions,
a set of type constraints which we omit for the time being,
a sequence of argument types, and a return type.</p>
<p>We can informally write them as:
<cite>forall (type_params), (arg_types) -&gt; ret_type where type_constraints</cite></p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>arg_types</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><em>tvm.relay.Type</em><em>]</em>) – The argument types</p></li>
<li><p><strong>ret_type</strong> (<em>tvm.relay.Type</em>) – The return type.</p></li>
<li><p><strong>type_params</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><em>tvm.relay.TypeVar</em><em>]</em><em>]</em>) – The type parameters</p></li>
<li><p><strong>type_constraints</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><em>tvm.relay.TypeConstraint</em><em>]</em><em>]</em>) – The type constraints.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.IncompleteType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">IncompleteType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">kind</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">TypeKind.Type</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IncompleteType" title="永久链接至目标">¶</a></dt>
<dd><p>Incomplete type during type inference.</p>
<dl class="simple">
<dt>kind<span class="classifier">Optional[TypeKind]</span></dt><dd><p>The kind of the incomplete type.</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.RelayRefType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">RelayRefType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.RelayRefType" title="永久链接至目标">¶</a></dt>
<dd><p>Reference Type in relay.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>value</strong> (<a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>Type</em></a>) – The value type.</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TensorType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TensorType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">shape</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dtype</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'float32'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TensorType" title="永久链接至目标">¶</a></dt>
<dd><p>A concrete TensorType in Relay.</p>
<p>This is the type assigned to tensors with a known dtype and shape.
For example, a tensor of <cite>float32</cite> and <cite>(5, 5)</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>shape</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.ir.PrimExpr" title="tvm.ir.PrimExpr"><em>tvm.ir.PrimExpr</em></a><em>]</em>) – The shape of the Tensor</p></li>
<li><p><strong>dtype</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a><em>]</em>) – The content data type.</p></li>
</ul>
</dd>
</dl>
<p><strong>Attributes:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.TensorType.concrete_shape" title="tvm.ir.TensorType.concrete_shape"><code class="xref py py-obj docutils literal notranslate"><span class="pre">concrete_shape</span></code></a></p></td>
<td><p>Get shape of the type as concrete tuple of int.</p></td>
</tr>
</tbody>
</table>
<dl class="py property">
<dt class="sig sig-object py" id="tvm.ir.TensorType.concrete_shape">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">concrete_shape</span></span><a class="headerlink" href="#tvm.ir.TensorType.concrete_shape" title="永久链接至目标">¶</a></dt>
<dd><p>Get shape of the type as concrete tuple of int.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>shape</strong> – The concrete shape of the Type.</p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List">List</a>[<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)">int</a>]</p>
</dd>
</dl>
<p>:raises TypeError : If the shape is symbolic:</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TensorAffineType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TensorAffineType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">scale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">zero_point</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dtype</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TensorAffineType" title="永久链接至目标">¶</a></dt>
<dd><p>The quantized type of a tensor, with scale, zero point, and datatype</p>
<p>The real space value is calculated as x = x_q * scale + zero_point</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>scale</strong> (<em>Expr</em>) – The scale</p></li>
<li><p><strong>zero_point</strong> (<em>Expr</em>) – The zero_point</p></li>
<li><p><strong>dtype</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The content data type.</p></li>
<li><p><strong>axis</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The axis for per-channel quantization.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TupleAffineType">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TupleAffineType</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">types</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TupleAffineType" title="永久链接至目标">¶</a></dt>
<dd><p>Affine types of a node with multiple outputs</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>types</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.ir.TensorAffineType" title="tvm.ir.TensorAffineType"><em>TensorAffineType</em></a><em>]</em>) – The shape of the Tensor</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TypeCall">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TypeCall</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TypeCall" title="永久链接至目标">¶</a></dt>
<dd><p>Type function application.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>func</strong> (<a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>tvm.ir.Type</em></a>) – The function.</p></li>
<li><p><strong>args</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>tvm.ir.Type</em></a><em>]</em>) – The arguments.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>type_call</strong> – The type function application.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.TypeCall" title="tvm.ir.TypeCall">TypeCall</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TypeRelation">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TypeRelation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">func</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">num_inputs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attrs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TypeRelation" title="永久链接至目标">¶</a></dt>
<dd><p>User defined type relation, it is an input-output relation on types.</p>
<dl class="simple">
<dt>TypeRelation is more generalized than TypeCall as it allows inference</dt><dd><p>of both inputs and outputs.</p>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>func</strong> (<a class="reference internal" href="#tvm.ir.EnvFunc" title="tvm.ir.EnvFunc"><em>EnvFunc</em></a>) – User defined relation function.</p></li>
<li><p><strong>args</strong> (<em>[</em><a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>tvm.ir.Type</em></a><em>]</em>) – List of types to the func.</p></li>
<li><p><strong>num_inputs</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – Number of input arguments in args,
this act as a hint for type inference.</p></li>
<li><p><strong>attrs</strong> (<a class="reference internal" href="#tvm.ir.Attrs" title="tvm.ir.Attrs"><em>Attrs</em></a>) – The attribute attached to the relation information</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>type_relation</strong> – The type relation.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.TypeRelation" title="tvm.ir.TypeRelation">tvm.ir.TypeRelation</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.BaseExpr">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">BaseExpr</span></span><a class="headerlink" href="#tvm.ir.BaseExpr" title="永久链接至目标">¶</a></dt>
<dd><p>Base class of all the expressions.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.PrimExpr">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">PrimExpr</span></span><a class="headerlink" href="#tvm.ir.PrimExpr" title="永久链接至目标">¶</a></dt>
<dd><p>Base class of all primitive expressions.</p>
<p>PrimExpr is used in the low-level code
optimizations and integer analysis.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.RelayExpr">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">RelayExpr</span></span><a class="headerlink" href="#tvm.ir.RelayExpr" title="永久链接至目标">¶</a></dt>
<dd><p>Base class of all non-primitive expressions.</p>
<p><strong>Attributes:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.RelayExpr.checked_type" title="tvm.ir.RelayExpr.checked_type"><code class="xref py py-obj docutils literal notranslate"><span class="pre">checked_type</span></code></a></p></td>
<td><p>Get the checked type of tvm.relay.Expr.</p></td>
</tr>
</tbody>
</table>
<dl class="py property">
<dt class="sig sig-object py" id="tvm.ir.RelayExpr.checked_type">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">checked_type</span></span><a class="headerlink" href="#tvm.ir.RelayExpr.checked_type" title="永久链接至目标">¶</a></dt>
<dd><p>Get the checked type of tvm.relay.Expr.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>checked_type</strong> – The checked type.</p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p>tvm.relay.Type</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.GlobalVar">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">GlobalVar</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name_hint</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.GlobalVar" title="永久链接至目标">¶</a></dt>
<dd><p>A global variable in the IR.</p>
<p>GlobalVar is used to refer to the global functions
stored in the IRModule.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>name_hint</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of the variable.</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Range">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Range</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">begin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">end</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">span</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Range" title="永久链接至目标">¶</a></dt>
<dd><p>Represent a range in TVM.</p>
<p>You do not need to create a Range explicitly.
Python lists and tuples will be converted automatically to a Range in API functions.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>begin</strong> (<a class="reference internal" href="#tvm.ir.PrimExpr" title="tvm.ir.PrimExpr"><em>PrimExpr</em></a>) – The begin value of the range when end is None.
Otherwise it is the length of the range.</p></li>
<li><p><strong>end</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="#tvm.ir.PrimExpr" title="tvm.ir.PrimExpr"><em>PrimExpr</em></a><em>]</em>) – The end value of the range.</p></li>
<li><p><strong>span</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="#tvm.ir.Span" title="tvm.ir.Span"><em>Span</em></a><em>]</em>) – The location of this itervar in the source code.</p></li>
</ul>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>The constructor creates the range <cite>[begin, end)</cite>
if the end argument is not None. Otherwise, it creates <cite>[0, begin)</cite>.</p>
</div>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Range.from_min_extent" title="tvm.ir.Range.from_min_extent"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_min_extent</span></code></a>(min_value, extent[, span])</p></td>
<td><p>Construct a Range by min and extent.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Range.from_min_extent">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">from_min_extent</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">min_value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">extent</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">span</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Range.from_min_extent" title="永久链接至目标">¶</a></dt>
<dd><p>Construct a Range by min and extent.</p>
<p>This constructs a range in [min_value, min_value + extent)</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>min_value</strong> (<a class="reference internal" href="#tvm.ir.PrimExpr" title="tvm.ir.PrimExpr"><em>PrimExpr</em></a>) – The minimum value of the range.</p></li>
<li><p><strong>extent</strong> (<a class="reference internal" href="#tvm.ir.PrimExpr" title="tvm.ir.PrimExpr"><em>PrimExpr</em></a>) – The extent of the range.</p></li>
<li><p><strong>span</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="#tvm.ir.Span" title="tvm.ir.Span"><em>Span</em></a><em>]</em>) – The location of this itervar in the source code.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>rng</strong> – The constructed range.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.Range" title="tvm.ir.Range">Range</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Op">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Op</span></span><a class="headerlink" href="#tvm.ir.Op" title="永久链接至目标">¶</a></dt>
<dd><p>Primitive operator in the IR.</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Op.get" title="tvm.ir.Op.get"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get</span></code></a>(op_name)</p></td>
<td><p>Get the Op for a given name</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Op.get_attr" title="tvm.ir.Op.get_attr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_attr</span></code></a>(attr_name)</p></td>
<td><p>Get additional attribute about the operator.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Op.set_attr" title="tvm.ir.Op.set_attr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_attr</span></code></a>(attr_name, value[, plevel])</p></td>
<td><p>Set attribute about the operator.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Op.reset_attr" title="tvm.ir.Op.reset_attr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset_attr</span></code></a>(attr_name)</p></td>
<td><p>Reset attribute about the operator.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Op.add_type_rel" title="tvm.ir.Op.add_type_rel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_type_rel</span></code></a>(rel_name[, type_rel_func])</p></td>
<td><p>Attach the type function corresponding to the return type.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Op.add_argument" title="tvm.ir.Op.add_argument"><code class="xref py py-obj docutils literal notranslate"><span class="pre">add_argument</span></code></a>(name, type, description)</p></td>
<td><p>Add arguments information to the function.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Op.set_support_level" title="tvm.ir.Op.set_support_level"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_support_level</span></code></a>(level)</p></td>
<td><p>Set the support level of op.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Op.set_num_inputs" title="tvm.ir.Op.set_num_inputs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_num_inputs</span></code></a>(n)</p></td>
<td><p>Set the support level of op.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Op.set_attrs_type_key" title="tvm.ir.Op.set_attrs_type_key"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_attrs_type_key</span></code></a>(key)</p></td>
<td><p>Set the attribute type key of op.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.get">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">op_name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.get" title="永久链接至目标">¶</a></dt>
<dd><p>Get the Op for a given name</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>op_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The operator name</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>op</strong> – The op of the corresponding name</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.Op" title="tvm.ir.Op">Op</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.get_attr">
<span class="sig-name descname"><span class="pre">get_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.get_attr" title="永久链接至目标">¶</a></dt>
<dd><p>Get additional attribute about the operator.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>attr_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The attribute name.</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>value</strong> – The attribute value</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(在 Python v3.10)">object</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.set_attr">
<span class="sig-name descname"><span class="pre">set_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">plevel</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">10</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.set_attr" title="永久链接至目标">¶</a></dt>
<dd><p>Set attribute about the operator.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>attr_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The attribute name</p></li>
<li><p><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(在 Python v3.10)"><em>object</em></a>) – The attribute value</p></li>
<li><p><strong>plevel</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The priority level</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.reset_attr">
<span class="sig-name descname"><span class="pre">reset_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.reset_attr" title="永久链接至目标">¶</a></dt>
<dd><p>Reset attribute about the operator.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>attr_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The attribute name</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.add_type_rel">
<span class="sig-name descname"><span class="pre">add_type_rel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">rel_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type_rel_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.add_type_rel" title="永久链接至目标">¶</a></dt>
<dd><p>Attach the type function corresponding to the return type.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>rel_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The type relation name to register.</p></li>
<li><p><strong>type_rel_func</strong> (<em>Optional</em><em>[</em><em>function</em><em> (</em><em>args: List</em><em>[</em><a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>Type</em></a><em>]</em><em>, </em><em>attrs: Attrs</em><em>) </em><em>-&gt; Type</em><em>]</em>) – <p>The backing relation function which can solve an arbitrary relation on variables.
Differences with type_rel_func in C++:</p>
<ol class="arabic simple">
<li><p>When type_rel_func is not None</p>
<ol class="loweralpha simple">
<li><p>OpAddTypeRel on C++ side will adjust type_rel_func with TypeReporter to
calling convention of relay type system.</p></li>
<li><p>type_rel_func returns output argument’s type, return None means can’t
infer output’s type.</p></li>
<li><p>only support single output operators for now, the last argument is output tensor.</p></li>
</ol>
</li>
<li><dl class="simple">
<dt>when type_rel_func is None, will call predefined type_rel_funcs in relay</dt><dd><p>according to <code class="docutils literal notranslate"><span class="pre">tvm.relay.type_relation.</span></code> + rel_name.</p>
</dd>
</dl>
</li>
</ol>
</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.add_argument">
<span class="sig-name descname"><span class="pre">add_argument</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">description</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.add_argument" title="永久链接至目标">¶</a></dt>
<dd><p>Add arguments information to the function.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The argument name.</p></li>
<li><p><strong>type</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The argument type.</p></li>
<li><p><strong>description</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The argument description.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.set_support_level">
<span class="sig-name descname"><span class="pre">set_support_level</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">level</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.set_support_level" title="永久链接至目标">¶</a></dt>
<dd><p>Set the support level of op.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>level</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The support level.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.set_num_inputs">
<span class="sig-name descname"><span class="pre">set_num_inputs</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.set_num_inputs" title="永久链接至目标">¶</a></dt>
<dd><p>Set the support level of op.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>n</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The input number.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Op.set_attrs_type_key">
<span class="sig-name descname"><span class="pre">set_attrs_type_key</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Op.set_attrs_type_key" title="永久链接至目标">¶</a></dt>
<dd><p>Set the attribute type key of op.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The type key.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.register_op_attr">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">register_op_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">op_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attr_key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">level</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">10</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.register_op_attr" title="永久链接至目标">¶</a></dt>
<dd><p>Register an operator property of an operator by name.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>op_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of operator</p></li>
<li><p><strong>attr_key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The attribute name.</p></li>
<li><p><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(在 Python v3.10)"><em>object</em></a><em>, </em><em>optional</em>) – The value to set</p></li>
<li><p><strong>level</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a><em>, </em><em>optional</em>) – The priority level</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>fregister</strong> – Register function if value is not specified.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p>function</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.register_intrin_lowering">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">register_intrin_lowering</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">op_name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">target</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">f</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">level</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">10</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.register_intrin_lowering" title="永久链接至目标">¶</a></dt>
<dd><p>Register Op lowering function</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>op_name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The op name</p></li>
<li><p><strong>target</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The target string for given intrinsic lowering function</p></li>
<li><p><strong>f</strong> (<em>function</em><em>, </em><em>optional</em>) – The function to be registered.</p></li>
<li><p><strong>level</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The priority level</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>fregister</strong> – Register op lowering function if f is not specified.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p>function</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.CallingConv">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">CallingConv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.CallingConv" title="永久链接至目标">¶</a></dt>
<dd><p>Possible kinds of calling conventions.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.BaseFunc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">BaseFunc</span></span><a class="headerlink" href="#tvm.ir.BaseFunc" title="永久链接至目标">¶</a></dt>
<dd><p>Base class of all functions.</p>
<p><strong>Attributes:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.BaseFunc.attrs" title="tvm.ir.BaseFunc.attrs"><code class="xref py py-obj docutils literal notranslate"><span class="pre">attrs</span></code></a></p></td>
<td><p>Return the attrs member of the function.</p></td>
</tr>
</tbody>
</table>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.BaseFunc.with_attr" title="tvm.ir.BaseFunc.with_attr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">with_attr</span></code></a>(attr_key_or_dict[, attr_value])</p></td>
<td><p>Create a new copy of the function and update the attribute.</p></td>
</tr>
</tbody>
</table>
<dl class="py property">
<dt class="sig sig-object py" id="tvm.ir.BaseFunc.attrs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">attrs</span></span><a class="headerlink" href="#tvm.ir.BaseFunc.attrs" title="永久链接至目标">¶</a></dt>
<dd><p>Return the attrs member of the function.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.BaseFunc.with_attr">
<span class="sig-name descname"><span class="pre">with_attr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attr_key_or_dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">attr_value</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.BaseFunc.with_attr" title="永久链接至目标">¶</a></dt>
<dd><p>Create a new copy of the function and update the attribute.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>attr_key_or_dict</strong> (<em>Union</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(在 Python v3.10)"><em>dict</em></a><em>]</em>) – The attribute key to use or a dict containing multiple key value pairs.</p></li>
<li><p><strong>attr_value</strong> (<a class="reference internal" href="runtime.html#tvm.runtime.Object" title="tvm.runtime.Object"><em>Object</em></a>) – The new attribute value.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>func</strong> – A new copy of the function</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p>Function</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Constructor">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Constructor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name_hint</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">inputs</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">belong_to</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Constructor" title="永久链接至目标">¶</a></dt>
<dd><p>Relay ADT constructor.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>name_hint</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – Name of constructor (only a hint).</p></li>
<li><p><strong>inputs</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.ir.Type" title="tvm.ir.Type"><em>Type</em></a><em>]</em>) – Input types.</p></li>
<li><p><strong>belong_to</strong> (<a class="reference internal" href="#tvm.ir.GlobalTypeVar" title="tvm.ir.GlobalTypeVar"><em>GlobalTypeVar</em></a>) – Denotes which ADT the constructor belongs to.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.TypeData">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">TypeData</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">header</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type_vars</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">constructors</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.TypeData" title="永久链接至目标">¶</a></dt>
<dd><p>Stores the definition for an Algebraic Data Type (ADT) in Relay.</p>
<p>Note that ADT definitions are treated as type-level functions because
the type parameters need to be given for an instance of the ADT. Thus,
any global type var that is an ADT header needs to be wrapped in a
type call that passes in the type params.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>header</strong> (<a class="reference internal" href="#tvm.ir.GlobalTypeVar" title="tvm.ir.GlobalTypeVar"><em>GlobalTypeVar</em></a>) – The name of the ADT.
ADTs with the same constructors but different names are
treated as different types.</p></li>
<li><p><strong>type_vars</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.ir.TypeVar" title="tvm.ir.TypeVar"><em>TypeVar</em></a><em>]</em>) – Type variables that appear in constructors.</p></li>
<li><p><strong>constructors</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.ir.Constructor" title="tvm.ir.Constructor"><em>Constructor</em></a><em>]</em>) – The constructors for the ADT.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.IRModule">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">IRModule</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">functions</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type_definitions</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule" title="永久链接至目标">¶</a></dt>
<dd><p>IRModule that holds functions and type definitions.</p>
<p>IRModule is the basic unit for all IR transformations across the stack.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>functions</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(在 Python v3.10)"><em>dict</em></a><em>]</em><em></em>) – Map of global var to BaseFunc</p>
</dd>
</dl>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.IRModule.update" title="tvm.ir.IRModule.update"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update</span></code></a>(other)</p></td>
<td><p>Insert functions in another Module to current one.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.IRModule.update_func" title="tvm.ir.IRModule.update_func"><code class="xref py py-obj docutils literal notranslate"><span class="pre">update_func</span></code></a>(var, func)</p></td>
<td><p>Update the function corresponding to a global variable in the module.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.IRModule.get_global_var" title="tvm.ir.IRModule.get_global_var"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_global_var</span></code></a>(name)</p></td>
<td><p>Get a global variable in the function by name.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.IRModule.get_global_vars" title="tvm.ir.IRModule.get_global_vars"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_global_vars</span></code></a>()</p></td>
<td><p>Collect all global vars defined in this module.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.IRModule.get_global_type_vars" title="tvm.ir.IRModule.get_global_type_vars"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_global_type_vars</span></code></a>()</p></td>
<td><p>Collect all global type vars defined in this module.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.IRModule.get_global_type_var" title="tvm.ir.IRModule.get_global_type_var"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_global_type_var</span></code></a>(name)</p></td>
<td><p>Get a global type variable in the function by name.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.IRModule.get_constructor" title="tvm.ir.IRModule.get_constructor"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_constructor</span></code></a>(tag)</p></td>
<td><p>Look up an ADT constructor by tag.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.IRModule.from_expr" title="tvm.ir.IRModule.from_expr"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_expr</span></code></a>(expr[, functions, type_defs])</p></td>
<td><p>Construct a module from a standalone expression.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.IRModule.script" title="tvm.ir.IRModule.script"><code class="xref py py-obj docutils literal notranslate"><span class="pre">script</span></code></a>([tir_prefix, show_meta])</p></td>
<td><p>Print IRModule into TVMScript</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.update">
<span class="sig-name descname"><span class="pre">update</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.update" title="永久链接至目标">¶</a></dt>
<dd><p>Insert functions in another Module to current one.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>other</strong> (<a class="reference internal" href="#tvm.ir.IRModule" title="tvm.ir.IRModule"><em>IRModule</em></a>) – The module to merge into the current Module.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.update_func">
<span class="sig-name descname"><span class="pre">update_func</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">var</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">func</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.update_func" title="永久链接至目标">¶</a></dt>
<dd><p>Update the function corresponding to a global variable in the
module.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>var</strong> (<a class="reference internal" href="#tvm.ir.GlobalVar" title="tvm.ir.GlobalVar"><em>GlobalVar</em></a>) – The global variable.</p></li>
<li><p><strong>func</strong> (<em>tvm.relay.Function</em>) – The function to be inserted.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.get_global_var">
<span class="sig-name descname"><span class="pre">get_global_var</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.get_global_var" title="永久链接至目标">¶</a></dt>
<dd><p>Get a global variable in the function by name.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of the global variable.</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>global_var</strong> – The global variable mapped to <code class="code docutils literal notranslate"><span class="pre">name</span></code>.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.GlobalVar" title="tvm.ir.GlobalVar">GlobalVar</a></p>
</dd>
<dt class="field-even">引发</dt>
<dd class="field-even"><p><strong>tvm.error.TVMError if we cannot find corresponding global var.</strong> – </p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.get_global_vars">
<span class="sig-name descname"><span class="pre">get_global_vars</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.get_global_vars" title="永久链接至目标">¶</a></dt>
<dd><p>Collect all global vars defined in this module.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>global_vars</strong> – An array of global vars.</p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p><a class="reference internal" href="#tvm.ir.Array" title="tvm.ir.Array">Array</a>[<a class="reference internal" href="#tvm.ir.GlobalVar" title="tvm.ir.GlobalVar">GlobalVar</a>]</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.get_global_type_vars">
<span class="sig-name descname"><span class="pre">get_global_type_vars</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.get_global_type_vars" title="永久链接至目标">¶</a></dt>
<dd><p>Collect all global type vars defined in this module.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>global_type_vars</strong> – An array of global type vars.</p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p><a class="reference internal" href="#tvm.ir.Array" title="tvm.ir.Array">Array</a>[<a class="reference internal" href="#tvm.ir.GlobalTypeVar" title="tvm.ir.GlobalTypeVar">GlobalTypeVar</a>]</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.get_global_type_var">
<span class="sig-name descname"><span class="pre">get_global_type_var</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.get_global_type_var" title="永久链接至目标">¶</a></dt>
<dd><p>Get a global type variable in the function by name.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The name of the global type variable.</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>global_type_var</strong> – The global variable mapped to <code class="code docutils literal notranslate"><span class="pre">name</span></code>.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.GlobalTypeVar" title="tvm.ir.GlobalTypeVar">GlobalTypeVar</a></p>
</dd>
<dt class="field-even">引发</dt>
<dd class="field-even"><p><strong>tvm.error.TVMError if we cannot find corresponding global type var.</strong> – </p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.get_constructor">
<span class="sig-name descname"><span class="pre">get_constructor</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tag</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.get_constructor" title="永久链接至目标">¶</a></dt>
<dd><p>Look up an ADT constructor by tag.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>tag</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The tag for a constructor.</p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>constructor</strong> – The constructor associated with the given tag,</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.Constructor" title="tvm.ir.Constructor">Constructor</a></p>
</dd>
<dt class="field-even">引发</dt>
<dd class="field-even"><p><strong>tvm.error.TVMError if the corresponding constructor cannot be found.</strong> – </p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.from_expr">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">from_expr</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">expr</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">functions</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">type_defs</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.IRModule.from_expr" title="永久链接至目标">¶</a></dt>
<dd><p>Construct a module from a standalone expression.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>expr</strong> (<a class="reference internal" href="#tvm.ir.RelayExpr" title="tvm.ir.RelayExpr"><em>RelayExpr</em></a>) – The starting expression</p></li>
<li><p><strong>global_funcs</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(在 Python v3.10)"><em>dict</em></a><em>]</em>) – Map of global vars to function definitions</p></li>
<li><p><strong>type_defs</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(在 Python v3.10)"><em>dict</em></a><em>]</em>) – Map of global type vars to type definitions</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>mod</strong> – A module containing the passed definitions,
where expr is set as the entry point
(wrapped in a function if necessary)</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="runtime.html#tvm.runtime.Module" title="tvm.runtime.Module">Module</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.IRModule.script">
<span class="sig-name descname"><span class="pre">script</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">tir_prefix</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><span class="pre">str</span></a></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">'tir'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_meta</span></span><span class="p"><span class="pre">:</span></span> <span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)"><span class="pre">bool</span></a></span> <span class="o"><span class="pre">=</span></span> <span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><span class="pre">str</span></a></span></span><a class="headerlink" href="#tvm.ir.IRModule.script" title="永久链接至目标">¶</a></dt>
<dd><p>Print IRModule into TVMScript</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tir_prefix</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The tir namespace prefix</p></li>
<li><p><strong>show_meta</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)"><em>bool</em></a>) – Whether to show meta information</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>script</strong> – The TVM Script of the IRModule</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)">str</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Attrs">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Attrs</span></span><a class="headerlink" href="#tvm.ir.Attrs" title="永久链接至目标">¶</a></dt>
<dd><p>Attribute node, which is mainly use for defining attributes of relay operators.</p>
<p>Used by function registered in python side, such as compute, schedule and alter_layout.
Attrs is passed as the first argument to these functions.</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Attrs.list_field_info" title="tvm.ir.Attrs.list_field_info"><code class="xref py py-obj docutils literal notranslate"><span class="pre">list_field_info</span></code></a>()</p></td>
<td><p>Get fields information</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Attrs.keys" title="tvm.ir.Attrs.keys"><code class="xref py py-obj docutils literal notranslate"><span class="pre">keys</span></code></a>()</p></td>
<td><p>Get list of names in the attribute.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Attrs.get_int_tuple" title="tvm.ir.Attrs.get_int_tuple"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_int_tuple</span></code></a>(key)</p></td>
<td><p>Get a python int tuple of a key</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Attrs.get_int" title="tvm.ir.Attrs.get_int"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_int</span></code></a>(key)</p></td>
<td><p>Get a python int value of a key</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Attrs.get_str" title="tvm.ir.Attrs.get_str"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_str</span></code></a>(key)</p></td>
<td><p>Get a python int value of a key</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Attrs.list_field_info">
<span class="sig-name descname"><span class="pre">list_field_info</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Attrs.list_field_info" title="永久链接至目标">¶</a></dt>
<dd><p>Get fields information</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>infos</strong> – List of field information</p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p>list of AttrFieldInfo</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Attrs.keys">
<span class="sig-name descname"><span class="pre">keys</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Attrs.keys" title="永久链接至目标">¶</a></dt>
<dd><p>Get list of names in the attribute.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>keys</strong> – List of keys</p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p>list of str</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Attrs.get_int_tuple">
<span class="sig-name descname"><span class="pre">get_int_tuple</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Attrs.get_int_tuple" title="永久链接至目标">¶</a></dt>
<dd><p>Get a python int tuple of a key</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – </p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>value</strong></p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p>Tuple of int</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Attrs.get_int">
<span class="sig-name descname"><span class="pre">get_int</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Attrs.get_int" title="永久链接至目标">¶</a></dt>
<dd><p>Get a python int value of a key</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – </p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>value</strong></p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)">int</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Attrs.get_str">
<span class="sig-name descname"><span class="pre">get_str</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Attrs.get_str" title="永久链接至目标">¶</a></dt>
<dd><p>Get a python int value of a key</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – </p>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>value</strong></p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)">int</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.DictAttrs">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">DictAttrs</span></span><a class="headerlink" href="#tvm.ir.DictAttrs" title="永久链接至目标">¶</a></dt>
<dd><p>Dictionary attributes.</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.DictAttrs.keys" title="tvm.ir.DictAttrs.keys"><code class="xref py py-obj docutils literal notranslate"><span class="pre">keys</span></code></a>()</p></td>
<td><p>Get list of names in the attribute.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.DictAttrs.items" title="tvm.ir.DictAttrs.items"><code class="xref py py-obj docutils literal notranslate"><span class="pre">items</span></code></a>()</p></td>
<td><p>Get items from the map.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.DictAttrs.keys">
<span class="sig-name descname"><span class="pre">keys</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.DictAttrs.keys" title="永久链接至目标">¶</a></dt>
<dd><p>Get list of names in the attribute.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>keys</strong> – List of keys</p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p>list of str</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.DictAttrs.items">
<span class="sig-name descname"><span class="pre">items</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.DictAttrs.items" title="永久链接至目标">¶</a></dt>
<dd><p>Get items from the map.</p>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.ir.make_node">
<span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">make_node</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">type_key</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.make_node" title="永久链接至目标">¶</a></dt>
<dd><p>Make a new IR node by its type key and fields</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>type_key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The type key of the node.</p></li>
<li><p><strong>**kwargs</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(在 Python v3.10)"><em>dict</em></a>) – The fields of the node.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>node</strong> – The corresponding IR Node</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference internal" href="#tvm.ir.Node" title="tvm.ir.Node">Node</a></p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>If the created node is instance of AttrsNode, then
the creator function will also run bound checks and
default value setup as supported by Attrs.</p>
</div>
<p class="rubric">示例</p>
<p>The following code constructs a IntImm object</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="n">tvm</span><span class="o">.</span><span class="n">ir</span><span class="o">.</span><span class="n">make_node</span><span class="p">(</span><span class="s2">&quot;IntImm&quot;</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="s2">&quot;int32&quot;</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">tvm</span><span class="o">.</span><span class="n">tir</span><span class="o">.</span><span class="n">IntImm</span><span class="p">)</span>
<span class="k">assert</span> <span class="n">x</span><span class="o">.</span><span class="n">value</span> <span class="o">==</span> <span class="mi">10</span>
</pre></div>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Array">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Array</span></span><a class="headerlink" href="#tvm.ir.Array" title="永久链接至目标">¶</a></dt>
<dd><p>Array container of TVM.</p>
<p>You do not need to create Array explicitly.
Normally python list and tuple will be converted automatically
to Array during tvm function call.
You may get Array in return values of TVM function call.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.ir.Map">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.ir.</span></span><span class="sig-name descname"><span class="pre">Map</span></span><a class="headerlink" href="#tvm.ir.Map" title="永久链接至目标">¶</a></dt>
<dd><p>Map container of TVM.</p>
<p>You do not need to create Map explicitly.
Normally python dict will be converted automatically to Map during tvm function call.
You can use convert to create a dict[Object-&gt; Object] into a Map</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#tvm.ir.Map.items" title="tvm.ir.Map.items"><code class="xref py py-obj docutils literal notranslate"><span class="pre">items</span></code></a>()</p></td>
<td><p>Get the items from the map</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#tvm.ir.Map.get" title="tvm.ir.Map.get"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get</span></code></a>(key[, default])</p></td>
<td><p>Get an element with a default value.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Map.items">
<span class="sig-name descname"><span class="pre">items</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Map.items" title="永久链接至目标">¶</a></dt>
<dd><p>Get the items from the map</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.ir.Map.get">
<span class="sig-name descname"><span class="pre">get</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">default</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.ir.Map.get" title="永久链接至目标">¶</a></dt>
<dd><p>Get an element with a default value.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(在 Python v3.10)"><em>object</em></a>) – The attribute key.</p></li>
<li><p><strong>default</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(在 Python v3.10)"><em>object</em></a>) – The default object.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>value</strong> – The result value.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(在 Python v3.10)">object</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-tvm.instrument">
<span id="tvm-instrument"></span><h1>tvm.instrument<a class="headerlink" href="#module-tvm.instrument" title="永久链接至标题">¶</a></h1>
<p>Common pass instrumentation across IR variants.</p>
<p><strong>类：</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">PassInstrument</span></code>()</p></td>
<td><p>A pass instrument implementation.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">PassTimingInstrument</span></code>()</p></td>
<td><p>A wrapper to create a passes time instrument that implemented in C++</p></td>
</tr>
</tbody>
</table>
<p><strong>函数：</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">pass_instrument</span></code>([pi_cls])</p></td>
<td><p>Decorate a pass instrument.</p></td>
</tr>
</tbody>
</table>
<dl class="py class">
<dt class="sig sig-object py" id="tvm.instrument.PassInstrument">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.instrument.</span></span><span class="sig-name descname"><span class="pre">PassInstrument</span></span><a class="headerlink" href="#tvm.instrument.PassInstrument" title="永久链接至目标">¶</a></dt>
<dd><p>A pass instrument implementation.</p>
<p>Users don’t need to interact with this class directly.
Instead, a <cite>PassInstrument</cite> instance should be created through
<a class="reference internal" href="#tvm.instrument.pass_instrument" title="tvm.instrument.pass_instrument"><code class="xref py py-func docutils literal notranslate"><span class="pre">pass_instrument()</span></code></a></p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.instrument.PassTimingInstrument">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.instrument.</span></span><span class="sig-name descname"><span class="pre">PassTimingInstrument</span></span><a class="headerlink" href="#tvm.instrument.PassTimingInstrument" title="永久链接至目标">¶</a></dt>
<dd><p>A wrapper to create a passes time instrument that implemented in C++</p>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">render</span></code>()</p></td>
<td><p>Retrieve rendered time profile result :returns: <strong>string</strong> – The rendered string result of time profiles :rtype: string</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.instrument.PassTimingInstrument.render">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">render</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.instrument.PassTimingInstrument.render" title="永久链接至目标">¶</a></dt>
<dd><p>Retrieve rendered time profile result
:returns: <strong>string</strong> – The rendered string result of time profiles
:rtype: string</p>
<p class="rubric">实际案例</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">timing_inst</span> <span class="o">=</span> <span class="n">PassTimingInstrument</span><span class="p">()</span>
<span class="k">with</span> <span class="n">tvm</span><span class="o">.</span><span class="n">transform</span><span class="o">.</span><span class="n">PassContext</span><span class="p">(</span><span class="n">instruments</span><span class="o">=</span><span class="p">[</span><span class="n">timing_inst</span><span class="p">]):</span>
    <span class="n">relay_mod</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">transform</span><span class="o">.</span><span class="n">InferType</span><span class="p">()(</span><span class="n">relay_mod</span><span class="p">)</span>
    <span class="n">relay_mod</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">transform</span><span class="o">.</span><span class="n">FoldScaleAxis</span><span class="p">()(</span><span class="n">relay_mod</span><span class="p">)</span>
    <span class="c1"># before exiting the context, get profile results.</span>
    <span class="n">profiles</span> <span class="o">=</span> <span class="n">timing_inst</span><span class="o">.</span><span class="n">render</span><span class="p">()</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.instrument.pass_instrument">
<span class="sig-prename descclassname"><span class="pre">tvm.instrument.</span></span><span class="sig-name descname"><span class="pre">pass_instrument</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pi_cls</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.instrument.pass_instrument" title="永久链接至目标">¶</a></dt>
<dd><p>Decorate a pass instrument.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><p><strong>pi_class</strong> (<em>class</em>) – Instrument class. See example below.</p>
</dd>
</dl>
<p class="rubric">实际案例</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@tvm.instrument.pass_instrument</span>
<span class="k">class</span> <span class="nc">SkipPass</span><span class="p">:</span>
    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">skip_pass_name</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">skip_pass_name</span> <span class="o">=</span> <span class="n">skip_pass_name</span>

    <span class="c1"># Uncomment to customize</span>
    <span class="c1"># def enter_pass_ctx(self):</span>
    <span class="c1">#    pass</span>

    <span class="c1"># Uncomment to customize</span>
    <span class="c1"># def exit_pass_ctx(self):</span>
    <span class="c1">#    pass</span>

    <span class="c1"># If pass name contains keyword, skip it by return False. (return True: not skip)</span>
    <span class="k">def</span> <span class="nf">should_run</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mod</span><span class="p">,</span> <span class="n">pass_info</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">skip_pass_name</span> <span class="ow">in</span> <span class="n">pass_info</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
            <span class="k">return</span> <span class="bp">False</span>
        <span class="k">return</span> <span class="bp">True</span>

    <span class="c1"># Uncomment to customize</span>
    <span class="c1"># def run_before_pass(self, mod, pass_info):</span>
    <span class="c1">#    pass</span>

    <span class="c1"># Uncomment to customize</span>
    <span class="c1"># def run_after_pass(self, mod, pass_info):</span>
    <span class="c1">#    pass</span>

<span class="n">skip_annotate</span> <span class="o">=</span> <span class="n">SkipPass</span><span class="p">(</span><span class="s2">&quot;AnnotateSpans&quot;</span><span class="p">)</span>
<span class="k">with</span> <span class="n">tvm</span><span class="o">.</span><span class="n">transform</span><span class="o">.</span><span class="n">PassContext</span><span class="p">(</span><span class="n">instruments</span><span class="o">=</span><span class="p">[</span><span class="n">skip_annotate</span><span class="p">]):</span>
    <span class="n">tvm</span><span class="o">.</span><span class="n">relay</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="s2">&quot;llvm&quot;</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>

</div>
<div class="section" id="module-tvm.transform">
<span id="tvm-transform"></span><h1>tvm.transform<a class="headerlink" href="#module-tvm.transform" title="永久链接至标题">¶</a></h1>
<p>Common pass infrastructure across IR variants.</p>
<p><strong>类：</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">ModulePass</span></code>()</p></td>
<td><p>A pass that works on tvm.IRModule.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">Pass</span></code>()</p></td>
<td><p>The base class of all passes.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">PassContext</span></code>([opt_level, required_pass, …])</p></td>
<td><p>The basis where a Relay optimization/analysis runs on.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">PassInfo</span></code>(opt_level, name[, required])</p></td>
<td><p>The class contains the meta data required by a pass.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">Sequential</span></code>([passes, opt_level, name, required])</p></td>
<td><p>A pass that works on a sequence of pass objects.</p></td>
</tr>
</tbody>
</table>
<p><strong>函数：</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">PrintIR</span></code>([header, show_meta_data])</p></td>
<td><p>A special trace pass that prints the header and IR.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">module_pass</span></code>([pass_func, opt_level, name, …])</p></td>
<td><p>Decorate a module pass.</p></td>
</tr>
</tbody>
</table>
<dl class="py class">
<dt class="sig sig-object py" id="tvm.transform.ModulePass">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.transform.</span></span><span class="sig-name descname"><span class="pre">ModulePass</span></span><a class="headerlink" href="#tvm.transform.ModulePass" title="永久链接至目标">¶</a></dt>
<dd><p>A pass that works on tvm.IRModule. Users don’t need to interact with
this class directly. Instead, a module pass should be created through
<cite>module_pass</cite>, because the design of the <cite>module_pass</cite> API is flexible
enough to handle the creation of a module pass in different manners. In
addition, all members of a module pass can be accessed from the base class.
The same rule applies to FunctionPass as well.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.transform.Pass">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.transform.</span></span><span class="sig-name descname"><span class="pre">Pass</span></span><a class="headerlink" href="#tvm.transform.Pass" title="永久链接至目标">¶</a></dt>
<dd><p>The base class of all passes. All methods here are just simple wrappers
that are implemented in the backend. They are defined for users to
conveniently interact with the base class.</p>
<p><strong>Attributes:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">info</span></code></p></td>
<td><p>Get the pass meta.</p></td>
</tr>
</tbody>
</table>
<dl class="py property">
<dt class="sig sig-object py" id="tvm.transform.Pass.info">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">info</span></span><a class="headerlink" href="#tvm.transform.Pass.info" title="永久链接至目标">¶</a></dt>
<dd><p>Get the pass meta.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.transform.PassContext">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.transform.</span></span><span class="sig-name descname"><span class="pre">PassContext</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opt_level</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required_pass</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">disabled_pass</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">instruments</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">config</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.PassContext" title="永久链接至目标">¶</a></dt>
<dd><p>The basis where a Relay optimization/analysis runs on.
Each pass context contains a number of auxiliary information that is used
to help an optimization pass. Such information includes the error reporter
to record the errors of during the optimization, etc.</p>
<dl class="simple">
<dt>opt_level<span class="classifier">Optional[int]</span></dt><dd><p>The optimization level of this pass.</p>
</dd>
<dt>required_pass<span class="classifier">Optional[Union[List[str], Set[str], Tuple[str]]]</span></dt><dd><p>The list of passes that are required by a certain pass.</p>
</dd>
<dt>disabled_pass<span class="classifier">Optional[Union[List[str], Set[str], Tuple[str]]]</span></dt><dd><p>The list of passes that are disabled.</p>
</dd>
<dt>instruments<span class="classifier">Optional[Sequence[PassInstrument]]</span></dt><dd><p>The list of pass instrument implementations.</p>
</dd>
<dt>config<span class="classifier">Optional[Dict[str, Object]]</span></dt><dd><p>Additional configurations for specific passes.</p>
</dd>
</dl>
<p><strong>Methods:</strong></p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">override_instruments</span></code>(instruments)</p></td>
<td><p>Override instruments within this PassContext.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">current</span></code>()</p></td>
<td><p>Return the current pass context.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">list_configs</span></code>()</p></td>
<td><p>List all registered <cite>PassContext</cite> configuration names and metadata.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="tvm.transform.PassContext.override_instruments">
<span class="sig-name descname"><span class="pre">override_instruments</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">instruments</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.PassContext.override_instruments" title="永久链接至目标">¶</a></dt>
<dd><p>Override instruments within this PassContext.</p>
<p>If there are existing instruments, their <code class="docutils literal notranslate"><span class="pre">exit_pass_ctx</span></code> callbacks are called.
Then switching to new instruments and calling new <code class="docutils literal notranslate"><span class="pre">enter_pass_ctx</span></code> callbacks.</p>
<dl class="simple">
<dt>instruments<span class="classifier">Sequence[PassInstrument]</span></dt><dd><p>The list of pass instrument implementations.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.transform.PassContext.current">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">current</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.PassContext.current" title="永久链接至目标">¶</a></dt>
<dd><p>Return the current pass context.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="tvm.transform.PassContext.list_configs">
<em class="property"><span class="pre">static</span> </em><span class="sig-name descname"><span class="pre">list_configs</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.PassContext.list_configs" title="永久链接至目标">¶</a></dt>
<dd><p>List all registered <cite>PassContext</cite> configuration names and metadata.</p>
<dl class="field-list simple">
<dt class="field-odd">返回</dt>
<dd class="field-odd"><p><strong>configs</strong></p>
</dd>
<dt class="field-even">返回类型</dt>
<dd class="field-even"><p><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.Dict" title="tvm.relay.dataflow_pattern.Dict">Dict</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)">str</a>, <a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.Dict" title="tvm.relay.dataflow_pattern.Dict">Dict</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)">str</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)">str</a>]]</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.transform.PassInfo">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.transform.</span></span><span class="sig-name descname"><span class="pre">PassInfo</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">opt_level</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.PassInfo" title="永久链接至目标">¶</a></dt>
<dd><p>The class contains the meta data required by a pass. It is the
container of information needed by running an optimization or analysis.
This class can be extended by adding new members when more meta data is
needed.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>opt_level</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The optimization level of this pass.</p></li>
<li><p><strong>name</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The pass name.</p></li>
<li><p><strong>required</strong> (<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a><em>]</em>) – The list of passes that are required by a certain pass.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.transform.PrintIR">
<span class="sig-prename descclassname"><span class="pre">tvm.transform.</span></span><span class="sig-name descname"><span class="pre">PrintIR</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">header</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">''</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_meta_data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.PrintIR" title="永久链接至目标">¶</a></dt>
<dd><p>A special trace pass that prints the header and IR.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>header</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a>) – The header to be displayed along with the dump.</p></li>
<li><p><strong>show_meta_data</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(在 Python v3.10)"><em>bool</em></a>) – A boolean flag to indicate if meta data should be printed.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p></p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p>The pass</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="tvm.transform.Sequential">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">tvm.transform.</span></span><span class="sig-name descname"><span class="pre">Sequential</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">passes</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opt_level</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'sequential'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.Sequential" title="永久链接至目标">¶</a></dt>
<dd><p>A pass that works on a sequence of pass objects. Multiple passes can be
executed sequentially using this class.</p>
<p>Note that users can also provide a series of passes that they don’t want to
apply when running a sequential pass. Pass dependency will be resolved in
the backend as well.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>passes</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference internal" href="#tvm.transform.Pass" title="tvm.transform.Pass"><em>Pass</em></a><em>]</em><em>]</em>) – A sequence of passes candidate for optimization.</p></li>
<li><p><strong>opt_level</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a><em>]</em>) – The optimization level of this sequential pass.
The opt_level of a default sequential pass is set to 0.
Note that some of the passes within the Sequantial may still not be executed
if their opt_level is higher than the provided opt_level.</p></li>
<li><p><strong>name</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a><em>]</em>) – The name of the sequential pass.</p></li>
<li><p><strong>required</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a><em>]</em><em>]</em>) – The list of passes that the sequential pass is dependent on.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="tvm.transform.module_pass">
<span class="sig-prename descclassname"><span class="pre">tvm.transform.</span></span><span class="sig-name descname"><span class="pre">module_pass</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">pass_func</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">opt_level</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">required</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#tvm.transform.module_pass" title="永久链接至目标">¶</a></dt>
<dd><p>Decorate a module pass.</p>
<p>This function returns a callback when pass_func is provided.
Otherwise, it serves a decorator function.</p>
<p>pass_func can also be a class type with a method transform_module.
This function will create a decorated ModulePass using transform_module
as the pass function.</p>
<dl class="field-list simple">
<dt class="field-odd">参数</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>pass_func</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.Callable" title="tvm.relay.dataflow_pattern.Callable"><em>Callable</em></a><em>[</em><em>(</em><a class="reference internal" href="runtime.html#tvm.runtime.Module" title="tvm.runtime.Module"><em>Module</em></a><em>, </em><a class="reference internal" href="#tvm.transform.PassContext" title="tvm.transform.PassContext"><em>PassContext</em></a><em>) </em><em>-&gt;Module</em><em>]</em><em>]</em>) – The transformation function or class.</p></li>
<li><p><strong>opt_level</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(在 Python v3.10)"><em>int</em></a>) – The optimization level of this module pass.</p></li>
<li><p><strong>name</strong> (<em>Optional</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a><em>]</em>) – The name of the module pass. The name could be empty. In this case, the
name of the optimization function will be used as the pass name.</p></li>
<li><p><strong>required</strong> (<em>Optional</em><em>[</em><a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.List" title="tvm.relay.dataflow_pattern.List"><em>List</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(在 Python v3.10)"><em>str</em></a><em>]</em><em>]</em>) – The list of passes that the module pass is dependent on.</p></li>
</ul>
</dd>
<dt class="field-even">返回</dt>
<dd class="field-even"><p><strong>create_module_pass</strong> – A decorator will be returned if pass_func is not provided,
otherwise return the decorated result.
The returned decorator has two behaviors depending on the input:
A new ModulePass will be returned when we decorate a pass function.
A new ModulePass class will be returned when we decorate a class type.</p>
</dd>
<dt class="field-odd">返回类型</dt>
<dd class="field-odd"><p>Union[<a class="reference internal" href="relay/dataflow_pattern.html#tvm.relay.dataflow_pattern.Callable" title="tvm.relay.dataflow_pattern.Callable">Callable</a>, <a class="reference internal" href="#tvm.transform.ModulePass" title="tvm.transform.ModulePass">ModulePass</a>]</p>
</dd>
</dl>
<p class="rubric">实际案例</p>
<p>The following code block decorates a module pass class.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@relay.transform.module_pass</span>
<span class="k">class</span> <span class="nc">CustomPipeline</span><span class="p">:</span>
    <span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">enable_fold</span><span class="p">):</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">enable_fold</span> <span class="o">=</span> <span class="n">enable_fold</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">cse</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">transform</span><span class="o">.</span><span class="n">EliminateCommonSubexpr</span><span class="p">()</span>
        <span class="bp">self</span><span class="o">.</span><span class="n">const_fold</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">transform</span><span class="o">.</span><span class="n">FoldConstant</span><span class="p">()</span>

    <span class="k">def</span> <span class="nf">transform_module</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mod</span><span class="p">,</span> <span class="n">ctx</span><span class="p">):</span>
        <span class="n">mod</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cse</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="n">ctx</span><span class="p">)</span>
        <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">enable_fold</span><span class="p">:</span>
            <span class="n">mod</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">const_fold</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="n">ctx</span><span class="p">)</span>
        <span class="k">return</span> <span class="n">mod</span>

<span class="c1"># create an instance of customized pipeline</span>
<span class="n">pipeline</span> <span class="o">=</span> <span class="n">CustomPipeline</span><span class="p">(</span><span class="n">enable_fold</span><span class="o">=</span><span class="bp">False</span><span class="p">)</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">pipeline</span><span class="p">,</span> <span class="n">transform</span><span class="o">.</span><span class="n">ModulePass</span><span class="p">)</span>
<span class="c1"># run the pipeline.</span>
<span class="n">output_module</span> <span class="o">=</span> <span class="n">pipeline</span><span class="p">(</span><span class="n">input_module</span><span class="p">)</span>
</pre></div>
</div>
<p>The following code creates a module pass by decorating
a user defined transform function.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="nd">@relay.transform.module_pass</span><span class="p">(</span><span class="n">opt_level</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="n">mod</span><span class="p">,</span> <span class="n">ctx</span><span class="p">):</span>
    <span class="n">tp</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">TensorType</span><span class="p">((</span><span class="mi">10</span><span class="p">,),</span> <span class="s2">&quot;float32&quot;</span><span class="p">)</span>
    <span class="n">x</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">var</span><span class="p">(</span><span class="s2">&quot;x&quot;</span><span class="p">,</span> <span class="n">tp</span><span class="p">)</span>
    <span class="n">gv</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">GlobalVar</span><span class="p">(</span><span class="s2">&quot;var&quot;</span><span class="p">)</span>
    <span class="n">func</span> <span class="o">=</span> <span class="n">relay</span><span class="o">.</span><span class="n">Function</span><span class="p">([</span><span class="n">x</span><span class="p">],</span> <span class="n">relay</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
    <span class="n">new_mod</span> <span class="o">=</span> <span class="n">tvm</span><span class="o">.</span><span class="n">IRModule</span><span class="p">({</span><span class="n">gv</span><span class="p">:</span> <span class="n">func</span><span class="p">})</span>
    <span class="n">new_mod</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="n">mod</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">new_mod</span>

<span class="n">module_pass</span> <span class="o">=</span> <span class="n">transform</span>
<span class="k">assert</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">module_pass</span><span class="p">,</span> <span class="n">transform</span><span class="o">.</span><span class="n">ModulePass</span><span class="p">)</span>
<span class="k">assert</span> <span class="n">module_pass</span><span class="o">.</span><span class="n">info</span><span class="o">.</span><span class="n">opt_level</span> <span class="o">==</span> <span class="mi">2</span>

<span class="c1"># Given a module m, the optimization could be invoked as the follwoing:</span>
<span class="n">updated_mod</span> <span class="o">=</span> <span class="n">module_pass</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>
<span class="c1"># Now a function abs should be added to the module m.</span>
</pre></div>
</div>
</dd></dl>

</div>


           </div>
           
          </div>
          

<footer>

    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="target.html" class="btn btn-neutral float-right" title="tvm.target" accesskey="n" rel="next">下一个 <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="error.html" class="btn btn-neutral float-left" title="tvm.error" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> 上一个</a>
      
    </div>

<div id="button" class="backtop"><img src="../../../_static//img/right.svg" alt="backtop"/> </div>
<section class="footerSec">
    <div class="footerHeader">
      <ul class="d-flex align-md-items-center justify-content-between flex-column flex-md-row">
        <li class="copywrite d-flex align-items-center">
          <h5 id="copy-right-info">© 2020 Apache Software Foundation | All right reserved</h5>
        </li>
      </ul>

    </div>

    <ul>
      <li class="footernote">Copyright © 2020 The Apache Software Foundation. Apache TVM, Apache, the Apache feather, and the Apache TVM project logo are either trademarks or registered trademarks of the Apache Software Foundation.</li>
    </ul>

</section>
</footer>
        </div>
      </div>

    </section>

  </div>
  

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

  </body>
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
    <!-- Theme Analytics -->
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-75982049-2', 'auto');
    ga('send', 'pageview');
    </script>

    
   

</body>
</html>